﻿using System.Collections.Generic;

namespace Services.Customers
{
    /// <summary>
    /// 用户注册返回结果
    /// </summary>
    public class CustomerRegistrationResult
    {
        /// <summary>
        /// 错误信息
        /// </summary>
        public IList<string> Errors { get; set; }

        /// <summary>
        /// 注册错误信息
        /// </summary>
        public CustomerRegistrationResult()
        {
            this.Errors = new List<string>();
        }

        /// <summary>
        /// 成功
        /// </summary>
        public bool Success
        {
            get { return this.Errors.Count == 0; }
        }

        /// <summary>
        /// 增加错误信息
        /// </summary>
        /// <param name="error"></param>
        public void AddError(string error)
        {
            this.Errors.Add(error);
        }
    }
}
